using LuckyLang.AST.Expression;

namespace LuckyLang.AST.Statement;

public class SetStatement : Statement
{
    public ID                    Id         { get; set; }
    public Expression.Expression Expression { get; set; }

    public SetStatement(ID id,Expression.Expression expression)
    {
        Id         = id;
        Expression = expression;
    }
    public override string ToString() => $"id:{Id} expr: {Expression}";
    public override void   Run(ref VariateManager Manager)
    {
        var a = Expression.GetValue(ref Manager);
        Manager.Post(Id,a);
    }
}